﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>猫咖控制台</title>
    <!-- Bootstrap Styles-->
    <link href="/static/css/bootstrap.min.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="/static/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="/static/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="/static/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
    <!--         vue-->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
    <!--         axios-->
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>

<body>
    <div id="wrapper">
        <nav class="navbar navbar-default top-navbar" role="navigation">
            <div th:insert="~{common/common::admin-top}"></div>
        </nav>
        <!--/. NAV TOP  -->
        <nav class="navbar-default navbar-side" role="navigation">
            <div th:insert="~{common/common::admin-left}"></div>
        </nav>
        <!-- /. NAV SIDE  -->
        <div id="page-wrapper">
            <div id="page-inner">
                <div class="row">
                    <div class="col-md-12">
                        <h1 class="page-header">
                            猫咖 <small>管理控制台</small>
                        </h1>
                    </div>
                </div>
                <!-- /. ROW  -->

                <div class="row" id="app">
                    <div class="col-md-3 col-sm-12 col-xs-12">
                        <div class="panel panel-primary text-center no-boder bg-color-green">
                            <div class="panel-body">
                                <i class="fa fa-bar-chart-o fa-5x"></i>
                                <h3>{{petCount}}</h3>
                            </div>
                            <div class="panel-footer back-footer-green">
                                宠物数量
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-12 col-xs-12">
                        <div class="panel panel-primary text-center no-boder bg-color-blue">
                            <div class="panel-body">
                                <i class="fa fa-shopping-cart fa-5x"></i>
                                <h3>{{buyCount}} </h3>
                            </div>
                            <div class="panel-footer back-footer-blue">
                                购买数量

                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-12 col-xs-12">
                        <div class="panel panel-primary text-center no-boder bg-color-red">
                            <div class="panel-body">
                                <i class="fa fa fa-comments fa-5x"></i>
                                <h3>{{oprationCount}} </h3>
                            </div>
                            <div class="panel-footer back-footer-red">
                                远程操作数量

                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-12 col-xs-12">
                        <div class="panel panel-primary text-center no-boder bg-color-brown">
                            <div class="panel-body">
                                <i class="fa fa-users fa-5x"></i>
                                <h3>{{userCount}} </h3>
                            </div>
                            <div class="panel-footer back-footer-brown">
                                用户数量

                            </div>
                        </div>
                    </div>
                </div>
                <!-- /. ROW  -->
				<footer><p>@猫咖 管理控制台</p></footer>
            </div>
            <!-- /. PAGE INNER  -->
        </div>
        <!-- /. PAGE WRAPPER  -->
    </div>
    <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="/static/js/jquery-1.10.2.js"></script>
    <!-- Bootstrap Js -->
    <script src="/static/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
    <script src="/static/js/jquery.metisMenu.js"></script>
    <!-- Morris Chart Js -->
    <script src="/static/js/morris/raphael-2.1.0.min.js"></script>
    <script src="/static/js/morris/morris.js"></script>
    <!-- Custom Js -->
    <script src="/static/js/custom-scripts.js"></script>
    <script>
        let vm = new Vue({
            el:'#app',
            data:{
                userCount:0,
                petCount:0,
                buyCount:0,
                OprationCount:0
            },
            mounted(){
                console.log('mounted')
                let that = this
                axios.get('/user/userCount').then(res=>{
                    that.userCount = res.data
                })
                axios.get('/pet/petCount').then(res=>{
                    that.petCount = res.data
                })
                axios.get('/buy/buyCount').then(res=>{
                    that.buyCount = res.data
                })
                axios.get('/userOpration/OprationCount').then(res=>{
                    that.OprationCount = res.data
                })
            }
        })
    </script>

</body>

</html>